package com.dsg.entity.approve;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 任務配置表
 * </p>
 *
 * @author system
 * @since 2020-07-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dsg_approve_task")
@ApiModel(value = "DsgApproveTask对象", description = "任務配置表")
public class DsgApproveTask implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主鍵")
    @TableId("OID")
    private String oid;

    @ApiModelProperty(value = "節點配置ID")
    @TableField("NODE_ID")
    private String nodeId;

    @ApiModelProperty(value = "任務名稱")
    @TableField("TASK_NAME")
    private String taskName;

    @ApiModelProperty(value = "審批對象類型")
    @TableField("RBAC_TYPE")
    private Integer rbacType;

    @ApiModelProperty(value = "審批對象ID")
    @TableField("RBAC_ID")
    private String rbacId;


    /**
     * 创建人
     */
    @TableField(value = "CREATER")
    @ApiModelProperty(value = "创建人", name = "creater")
    private String creater;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    @ApiModelProperty(value = "创建时间", name = "createTime")
    private Date createTime;

    /**
     * 更新人
     */
    @TableField(value = "UPDATER")
    @ApiModelProperty(value = "更新人", name = "updater")
    private String updater;

    /**
     * 更新时间
     */
    @TableField(value = "UPDATE_TIME")
    @ApiModelProperty(value = "更新时间", name = "updateTime")
    private Date updateTime;

    /**
     * 企業編號
     */
    @TableField(value = "ENT_CODE")
    @ApiModelProperty(value = "企業編號", name = "entCode")
    private String entCode;

    public enum RbacType {
        user(1), org(2), role(3);
        Integer code;

        RbacType(int code) {
            this.code = code;
        }

        public Integer getCode() {
            return code;
        }
    }
}
